package 设计模式.创建型模式.demo05单例模式;


/**
 * @author: 王富贵
 * @description: 懒汉式，使用才创建，线程不安全
 * @createTime: 2022/11/07 16:46
 */
public class LazySingle {
    private static LazySingle instance = null;

    private LazySingle() {}

    public LazySingle getInstance() {
        if (instance == null) {
            instance = new LazySingle();
        }
        return instance;
    }
}
